<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>constructor configure / Gio.js</title>

    <script src="js/three.min.js"></script>
    <script src="js/jquery.min.js"></script>

    <script src="../build/gio.min.js"></script>

    <link rel="stylesheet" href="css/common.css">

    <style>

        #globalArea {

            height: 100%;
            width: 100%;
            margin: 0;
            padding: 0;

        }

    </style>

</head>
<body>

<header>Configure in the constructor of Controller</header>

<div id="globalArea"></div>

<div class="view_source">
    <a href="https://github.com/syt123450/Gio.js/blob/master/examples/16_constructor_configure.html">View Source</a>
</div>

<script>

    var container = document.getElementById( "globalArea" );

    // use the constructor and JSON object to configure the controller. The attribute of JSON object can be seen in API document

    var controller = new GIO.Controller( container, {

        color: {

            surface: 0xff0000,
            selected: 0x00ffff,
            in: 0xffff00,
            out: 0x00ffff,
            halo: 0x00ff00

        },

        brightness: {

            ocean: 0.2

        }

    } );

    $.ajax( {

        url: "data/sampleData.json",
        type: "GET",
        contentType: "application/json; charset=utf-8",
        async: true,
        dataType: "json",
        success: function ( inputData ) {

            controller.addData( inputData );
            controller.init();

        }

    } );

</script>

</body>
</html>